package com.wla.config;

import com.wla.BlueCOlor;
import com.wla.Color;
import com.wla.RedColor;
import com.wla.condition.BlueColorCondition;
import com.wla.condition.RedColorCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: lijinze
 * @createDate: 2020/7/28
 */
@Configuration
public class ColorConfig {


    @Bean("color")
    @Conditional(RedColorCondition.class)

    public Color getRedColor() {
        return new RedColor();
    }
    @Bean("color")
    @Conditional(BlueColorCondition.class)
    public Color getBlueColor() {
        return new BlueCOlor();
    }
}
